﻿@ModelType Product

@Code
    ViewData("Title") = ViewData("ActionType")
    
End Code

<!-- Modal -->
<div class="modal-header success">
    <button type="button" class="close" data-dismiss="modal">
        <span aria-hidden="true">&times;</span>
        <span class="sr-only">Close</span>
    </button>
    <h4 class="modal-title" id="myModalLabel">@ViewData("ActionType") product</h4>
</div>
            
<div class="modal-body">
    @Using (Html.BeginForm(ViewData("ActionType").ToString, "Product", FormMethod.Post))
    @*@Using (Html.BeginForm())*@
        @Html.AntiForgeryToken()

        @<div class="form-horizontal">
            @Html.ValidationSummary(True)
            @Code
            If ("Edit").Equals(ViewData("ActionType")) Then 
            End Code
                @Html.HiddenFor(Function(model) model.ProductID)
            @Code
            End If
            End Code

            <div class="form-group">
                @Html.LabelFor(Function(model) model.ProductName, New With {.class = "control-label col-md-3"})
                <div class="col-md-8">
                    @Html.EditorFor(Function(model) model.ProductName)
                    @Html.ValidationMessageFor(Function(model) model.ProductName)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(Function(model) model.SupplierID, "SupplierID", New With {.class = "control-label col-md-3"})
                <div class="col-md-8">
                    @Html.DropDownList("SupplierID", String.Empty)
                    @Html.ValidationMessageFor(Function(model) model.SupplierID)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(Function(model) model.CategoryID, "CategoryID", New With {.class = "control-label col-md-3"})
                <div class="col-md-8">
                    @Html.DropDownList("CategoryID", 0)
                    @Html.ValidationMessageFor(Function(model) model.CategoryID)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(Function(model) model.QuantityPerUnit, New With {.class = "control-label col-md-3"})
                <div class="col-md-8">
                    @Html.EditorFor(Function(model) model.QuantityPerUnit)
                    @Html.ValidationMessageFor(Function(model) model.QuantityPerUnit)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(Function(model) model.UnitPrice, New With {.class = "control-label col-md-3"})
                <div class="col-md-8">
                    @Html.EditorFor(Function(model) model.UnitPrice)
                    @Html.ValidationMessageFor(Function(model) model.UnitPrice)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(Function(model) model.UnitsInStock, New With {.class = "control-label col-md-3"})
                <div class="col-md-8">
                    @Html.EditorFor(Function(model) model.UnitsInStock)
                    @Html.ValidationMessageFor(Function(model) model.UnitsInStock)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(Function(model) model.UnitsOnOrder, New With {.class = "control-label col-md-3"})
                <div class="col-md-8">
                    @Html.EditorFor(Function(model) model.UnitsOnOrder)
                    @Html.ValidationMessageFor(Function(model) model.UnitsOnOrder)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(Function(model) model.ReorderLevel, New With {.class = "control-label col-md-3"})
                <div class="col-md-8">
                    @Html.EditorFor(Function(model) model.ReorderLevel)
                    @Html.ValidationMessageFor(Function(model) model.ReorderLevel)
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(Function(model) model.Discontinued, New With {.class = "control-label col-md-3"})
                <div class="col-md-8">
                    @Html.EditorFor(Function(model) model.Discontinued)
                    @Html.ValidationMessageFor(Function(model) model.Discontinued)
                </div>
            </div>
        </div>
        
        @<div class="modal-footer">
             <button type="submit" class="btn btn-primary">Save</button>
             <button type="button" class="btn btn-primary" data-dismiss="modal">Back</button>            
        </div>
    End Using
</div>

@Section Scripts
    @Scripts.Render("~/bundles/jqueryval")    
End section
